package org.agile4j.patterns.prototype.order;

/**
 * 个人订单对象
 * @author user
 *
 */
public class PersonalOrder implements Cloneable, OrderApi {
	
	/**
	 * 订购人员姓名
	 */
	private String  customerName ;

	/**
	 * 产品编号
	 */
	private String productId ;
	
	/**
	 * 订单产品数量
	 */
	private int orderProductNum = 0;
	

	public int getOrderProductNum() {
		return orderProductNum;
	}

	public void setOrderProductNum(int orderProductNum) {
		this.orderProductNum = orderProductNum;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	@Override
	public String toString() {
		return "PersonalOrder [customerName=" + customerName + ", productId=" + productId + ", orderProductNum=" + orderProductNum + "]";
	}

//	@Override
//	public OrderApi cloneOrder() {
//		PersonalOrder order = new PersonalOrder() ;
//		order.setCustomerName(this.customerName);
//		order.setOrderProductNum(this.orderProductNum);
//		order.setProductId(this.productId);
//		return order;
//	}

	@Override
	protected Object clone() {
		Object obj = null;
		try {
			obj = super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return obj;
	}
}
